import styles from './index.less';
import "../styles/index.less";
import 'antd/dist/antd.css';  

import {Provider} from "mobx-react"
import {store} from "../mobx/store"
import {GolBalContext} from "../redux/index"
import {reducers}  from "../redux/reducers"
import {useReducer} from "react"
import {initState} from '../redux/state';


// 全局的根组件  
export default function IndexPage(props:any) {
  const [state,dispatch] = useReducer(reducers,initState)
  return (
    // mobx 
    <Provider { ...store}>
      {/* redux  */}
      <GolBalContext.Provider value={{state,dispatch} }>
        <div className="index"> 
            
            {/* 子路由嵌套  */}
            {props.children}
        </div>
      </GolBalContext.Provider>

    </Provider>

  );
}




